import { eventBus } from "./store.js"

export default{
    template:`
    <div style="border:1px solid red">
        <p>{{msg}}</p>    
        <button @click="btnClick">修改</button>
    </div>
    `,
    computed:{
        msg(){
            return eventBus.msg;
        }
    },
    
    methods: {
        btnClick(){
            eventBus.$emit("change-msg","我是子组件修改的")
        }
    },
}